<template>
  <div id="app" class="app-container">
    <div class="main-content">
      <Sidebar @class-selected="handleClassSelected" />
      <StudentTable v-if="selectedClass" />
    </div>
  </div>
</template>

<script lang="ts">
import Sidebar from '../../components/ClassGovern/SideBar.vue';
import StudentTable from '../../components/ClassGovern/StudentTable.vue';

export default {
  name: 'App',
  components: {
    Sidebar,
    StudentTable
  },
  data() {
    return {
      selectedClass: null,
      students: [] as any[]
    };
  },
  methods: {
    handleClassSelected(classId: null) {
      this.selectedClass = classId;
    }
  }
}
</script>

<style scoped>
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-container {
  flex-grow: 1;
  display: flex;
  flex-direction: row;
}

.main-content {
  display: flex;
  flex-grow: 1;
}

.sidebar {
  background-color: #444;
  color: #fff;
  padding: 10px;
  width: 200px;
  height: 100%;
  overflow-y: auto;
}

.student-table {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}
</style>
